//
//  picTableViewCell.m
//  jiaxingchengtou
//
//  Created by michael on 2018/5/25.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "picTableViewCell.h"

@implementation picTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
 if (self) {
          self.selectionStyle = UITableViewCellSelectionStyleNone;

   _label = [[UILabel alloc]initWithFrame:CGRectZero];
//              _label.numberOfLines = 0;
//              _label.backgroundColor = [UIColor redColor];
    _label.frame = CGRectZero;

    _label.font = [UIFont systemFontOfSize:14];
//    [self.contentView addSubview:_label];
    _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
//    _label1.backgroundColor = [UIColor greenColor];
           _label1.numberOfLines = 0;
       [self.contentView addSubview:_label1];
     
}

    return self;

}
- (void)layoutSubviews
{
[super layoutSubviews];
 NSArray * tempArray = [_allString componentsSeparatedByString:@"##"];
//    self.label.text = [NSString stringWithFormat:@"%@:",tempArray.firstObject];
if ([tempArray.lastObject isEqualToString:@"null"]) {
         self.label1.text = @"";
    }else{
        self.label1.text = tempArray.lastObject;
        
    }
    
//  _label.frame = CGRectMake(10, 0, 80, 44);

  if ([tempArray.firstObject isEqualToString:@"内容"]) {
             _label1.textAlignment = 0;

        [_label1 setFont:[UIFont systemFontOfSize:14]];

      CGFloat  titlesize1  = [OAToolBox sizebyText:tempArray.lastObject font:14 minsWidth:20];

  if (titlesize1 > 44) {
        _label1.frame = CGRectMake(10, 0, KScreenWidth-20,titlesize1);

}else{
        _label1.frame = CGRectMake(10, 0, KScreenWidth-20,44);

}



}else{
           _label1.textAlignment = 1;

      [_label1 setFont:[UIFont systemFontOfSize:16]];

  CGFloat  titlesize1  = [OAToolBox sizebyText:tempArray.lastObject font:16 minsWidth:20];

 if (titlesize1 > 44) {
        _label1.frame = CGRectMake(10, 0, KScreenWidth-20,titlesize1);

}else{
        _label1.frame = CGRectMake(10, 0, KScreenWidth-20,44);

}

}


}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
